package com.lds.config.center.server.business.item.converter;

import com.lds.config.center.common.model.item.request.ItemBaseGetByKeyRequest;
import com.lds.config.center.server.business.item.entity.Item;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class ItemBaseGetByKeyRequestToEntityConverter implements Converter<ItemBaseGetByKeyRequest, Item> {

    @Override
    public Item convert(ItemBaseGetByKeyRequest source) {
        return Item.builder()
                .name(source.getName())
                .namespaceId(source.getNamespaceId())
                .build();
    }

}